import { _decorator, Component, Node, randomRange, tween, v3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Train')
export class Train extends Component {
    start() {
        tween(this.node)
            .delay(randomRange(0, 3))
            .to(2, { position: v3(-1800, 120) })
            .set({ position: v3(1800, 120) })
            .delay(randomRange(10, 20)).union().repeatForever().start();
    }

    update(deltaTime: number) {

    }
}


